<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="format-detection" content="telephone=no">
  <meta name="msapplication-tap-highsecondary" content="no">
  <meta name="viewport" content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width">

  <title>询价列表 -供方报名查看</title>
  <link href="../lib/fonts/material-icons.css?family=Material+Icons" rel="stylesheet">
  <link href="../lib/css/animate.min.css" rel="stylesheet">
  <link href="../lib/css/quasar.mat.rtl.min.css" rel="stylesheet" type="text/css">
  <style>
    [v-cloak] { display: none }
    div.q-field-vertical .q-field-label+.q-field-content { padding-top: 0!important }
    .search-group-left { font-size: 13px; border: 1px solid #ccc; padding: 3px 6px!important; border-radius: 3px 0 0 3px; border-right: none }
      .search-group-right { font-size: 13px;border: 1px solid #ccc; padding: 3px 6px!important; border-radius: 0 3px 3px 0 }
  </style>
</head>
<body>
<div id="q-rfxVendorEnquiryPriceView" v-cloak>
  <q-layout>
    <q-page-container>
      <q-card class="bg-white full-width">
    <q-card-main>
      <q-tabs
              align="left"
              v-model="selectedTab"
              :two-lines="false"
              inverted
              color="primary">
        <q-tab slot="title"  name="tab-1" label="基本信息" ></q-tab>
        <q-tab slot="title"  name="tab-2" label="行项目" ></q-tab>
        <q-tab slot="title"  name="tab-3" label="询价附件" ></q-tab>
        <q-tab-pane name="tab-1">
          <q-stepper-navigation class="q-px-md"></q-stepper-navigation>
          <div class="row justify-between q-pa-sm position-relative">
            <div style="width: 85%" >
              <p class="q-ml-md row gutter-x-sm">
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    询价主题：
                    <span class="text-light">{{baseInfoForm.title}}</span>
                  </span>
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    询价类型：
                    <span class="text-light" v-if="baseInfoForm.type==1">project - 项目</span>
                    <span class="text-light" v-if="baseInfoForm.type==2">price-调价</span>
                    <span class="text-light" v-if="baseInfoForm.type==3">PCN -产品变更</span>
                    <span class="text-light" v-if="baseInfoForm.type==4">ECN-工程变更</span>
                    <span class="text-light" v-if="baseInfoForm.type==5">Supplier 供方变更</span>
                  </span>
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    密封报价：
                    <q-chip v-if="baseInfoForm.isSeal==1" dense square color="positive">是</q-chip>
                    <q-chip v-if="baseInfoForm.isSeal==0" dense square color="light">否</q-chip>
                  </span>
              </p>
              <p class="q-ml-md row gutter-x-sm">
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    采购组织：
                    <span class="text-light">{{baseInfoForm.purOrgName}}</span>
                  </span>
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    采购组：
                    <span class="text-light">{{baseInfoForm.purGroupName}}</span>
                  </span>
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    采购执行人：
                    <span class="text-light">
                      {{baseInfoForm.purExecutorName}}
                    </span>
                  </span>
              </p>
              <p class="q-ml-md row gutter-x-sm">
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    需要报名：
                    <q-chip v-if="baseInfoForm.isSignUp==1" dense square color="positive">是</q-chip>
                    <q-chip v-if="baseInfoForm.isSignUp==0" dense square color="light">否</q-chip>
                  </span>
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    报名开始时间：
                    <span class="text-light">{{baseInfoForm.signUpStartTime}}</span>
                  </span>
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    报名结束时间：
                    <span class="text-light">
                      {{baseInfoForm.signUpEndTime}}
                    </span>
                  </span>
              </p>
              <p class="q-ml-md row gutter-x-sm">
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    报价开始时间：
                    <span class="text-light">{{baseInfoForm.quoteStartTime}}</span>
                  </span>
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    报价结束时间：
                    <span class="text-light">{{baseInfoForm.quoteEndTime}}</span>
                  </span>
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    允许报价修改次数：
                    <q-chip dense color="positive" square>
                      {{baseInfoForm.quoteModifyTimes}}
                    </q-chip>
                  </span>
              </p>
              <p class="q-ml-md row gutter-x-sm">
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    是否TR：
                    <q-chip v-if="baseInfoForm.isTr==1" dense square color="positive">是</q-chip>
                    <q-chip v-if="baseInfoForm.isTr==0" dense square color="light">否</q-chip>
                  </span>
                  <span v-if="baseInfoForm.isTr==1" class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    TR文件：
                    <span class="text-light"><a :href="downloadUrl+baseInfoForm.trFileId" target="_blank" style="text-decoration: none;">点击下载</a></span>
                  </span>
                  <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                    报价说明：
                     <span class="text-light"> {{baseInfoForm.remark}}</span>
                  </span>
              </p>
            </div>
          </div>
        </q-tab-pane>
        <q-tab-pane name="tab-2">
          <div class="row justify-end">
            <q-input 
              class="search-group-left"
              hide-underline
              placeholder="输入编码"
              v-model.trim="searchFormRow.value"></q-input>
            <q-select 
              class="search-group-right"
              hide-underline
              radio
              :options="[{ label:'编码', value: 'matCode' }]"
              v-model="searchFormRow.key"></q-select>
            <q-btn
              size="sm"
              color="primary"
              :loading="btnLoadingSearch"
              @click="searchDetails"
              class="q-ml-sm q-pa-sm">
              <span slot="loading">
                <q-spinner-hourglass></q-spinner-hourglass>
                搜索中
              </span>
              <q-icon name="search"></q-icon>
              <span>{{ $t('查询') }}</span>
            </q-btn>
            <q-btn
              size="sm"
              color="secondary"
              @click="resetDetails"
              :loading="btnLoadingReset"
              class="q-ml-sm q-pa-sm">
              <span slot="loading">
                <q-spinner-hourglass></q-spinner-hourglass>
                重置中
              </span>
              <q-icon name="refresh" ></q-icon>
              <span>{{ $t('重置') }}</span>
            </q-btn>
          </div>
          <q-table
                  class="no-shadow"
                  :data="tableData"
                  dense
                  hide-bottom
                  :columns="columnsOne"
                  :rows-per-page-options="[5, 10, 20]"
                  selection="multiple"
                  :loading="listLoading"
                  :selected.sync="selectedOne"
                  :pagination.sync="serverPagination"
                  @request="listGet"
                  row-key="id"
          >
            <template slot="body" slot-scope="props">
              <q-tr
                      :props="props"
              >
                <q-td >
                  <q-checkbox color="primary" v-model="props.selected"></q-checkbox>
                </q-td>
                <q-td key="action" :props="props" >
                  <q-btn
                          flat
                          size="xs"
                          color="primary"
                          class="q-pa-xs"
                          @click="historicalQuotation(props.row.id)"
                  >
                    {{ $t('历史报价') }}
                  </q-btn>
                </q-td>
                <q-td key="matName" :props="props" >
                  {{props.row.matName }}
                </q-td>
                <q-td key="matCode" :props="props" >
                  {{props.row.matCode }}
                </q-td>
                <q-td key="matCategoryName" :props="props" >
                  {{props.row.matCategoryName }}
                </q-td>
                <q-td key="quantity" :props="props" >
                  {{props.row.quantity }}
                </q-td>
                <q-td key="unitName" :props="props" >
                  {{props.row.unitName }}
                </q-td>
                <q-td key="currencyName" :props="props" >
                  {{props.row.currencyName }}
                </q-td>
                <q-td key="quoteTempName" :props="props" >
                  {{props.row.quoteTempName }}
                </q-td>
                <q-td key="isMoldCostShare" :props="props" >
                  <q-chip v-if="props.row.isMoldCostShare == 1" dense square color="positive">是</q-chip>
                  <q-chip v-if="props.row.isMoldCostShare == 0" dense square color="light">否</q-chip>
                </q-td>
              </q-tr>
            </template>
          </q-table>
          <div class="row justify-end items-center text-faded">
            每页的行数：
            <q-select
                    :options="[{label: '5', value: 5},{label: '10', value: 10},{label: '20', value: 20}]"
                    hide-underline
                    class="q-mr-md"
                    v-model="serverPagination.rowsPerPage"></q-select>
            第
            <q-pagination
                    class="q-mt-xs"
                    v-model="serverPagination.page"
                    input
                    boundary-links
                    direction-links
                    :max-pages="5"
                    :ellipses="true"
                    :max="pages"></q-pagination>
            页 &nbsp; 共 {{ total }} 条
          </div>
        </q-tab-pane>
        <q-tab-pane name="tab-3">
          <q-table
                  class="no-shadow"
                  :data="tableDataTwo"
                  dense
                  hide-bottom
                  :columns="columnsTwo"
                  :rows-per-page-options="[5, 10, 20]"
                  selection="multiple"
                  :loading="listLoadingTwo"
                  :selected.sync="selectedTwo"
                  :pagination.sync="serverPaginationTwo"
                  @request="listGetTwo"
                  row-key="id"
          >
            <template slot="body" slot-scope="props">
              <q-tr :props="props" >
                <q-td >
                  <q-checkbox color="primary" v-model="props.selected"></q-checkbox>
                </q-td>
                <q-td key="action" :props="props" >
                  <q-btn
                          flat
                          color="primary"
                          class="q-pa-none"
                          @click="downloadFile(props.row.id)">
                    {{ '下载' }}
                  </q-btn>
                </q-td>
                <q-td key="fileName" :props="props" >
                  <q-btn
                          flat
                          color="primary"
                          class="q-pa-none">
                    {{ props.row.fileName }}
                  </q-btn>
                </q-td>
                <q-td key="suffix" :props="props" >
                  {{ props.row.suffix }}
                </q-td>
                <q-td key="updateUserName" :props="props" >
                  {{ props.row.updateUserName }}
                </q-td>
                <q-td key="lastUpdateTime" :props="props" >
                  {{ props.row.lastUpdateTime }}
                </q-td>
                <q-td key="remark" :props="props" >
                  {{ props.row.remark }}
                </q-td>
              </q-tr>
            </template>
          </q-table>
          <div class="row justify-end items-center text-faded">
            每页的行数：
            <q-select
                    :options="[{label: '5', value: 5},{label: '10', value: 10},{label: '20', value: 20}]"
                    hide-underline
                    class="q-mr-md"
                    v-model="serverPaginationTwo.rowsPerPage"></q-select>
            第
            <q-pagination
                    class="q-mt-xs"
                    v-model="serverPaginationTwo.page"
                    input
                    boundary-links
                    direction-links
                    :max-pages="5"
                    :ellipses="true"
                    :max="pagesTwo"></q-pagination>
            页 &nbsp; 共 {{ totalTwo }} 条
          </div>
        </q-tab-pane>
       </q-tabs>
    </q-card-main>
  </q-card>
    </q-page-container>
    <q-page-sticky position="top-right" :offset="[32,20]">
      <q-fab
              color="primary"
              icon="keyboard_arrow_down"
              direction="down"
      >
        <q-fab-action
                color="secondary"
                @click="back()"
                icon="arrow_back">
          <q-tooltip anchor="center left" self="center right" :offset="[10, 10]">返回</q-tooltip>
        </q-fab-action>
      </q-fab>
    </q-page-sticky>
  </q-layout>
  <q-modal no-backdrop-dismiss v-model="historicalQuotationModal" :content-css="{minWidth: '95%', minHeight: '95%',borderRadius: '4px'}">
    <q-modal-layout>
      <q-toolbar slot="header" color="white">
        <q-toolbar-title class="text-dark">
          {{ '历史报价'  }}
        </q-toolbar-title>
        <q-btn flat @click="historicalQuotationModal = false">
          <q-icon name="close" color="dark"></q-icon>
        </q-btn>
      </q-toolbar>
      <q-card class="bg-white no-shadow full-width">
        <q-card-main class="q-pa-sm">
          <q-tabs
                  align="left"
                  v-model="mainTab"
                  :two-lines="false"
                  inverted
                  color="primary">
            <!--<q-tab slot="title" name="mainInfo" label="已报价" ></q-tab>-->
            <q-tab-pane name="mainInfo">
              <q-table
                      class="no-shadow"
                      :data="tableDataThree"
                      dense
                      hide-bottom
                      :columns="columnsThree"
                      :rows-per-page-options="[5, 10, 20]"
                      selection="multiple"
                      :loading="listLoadingThree"
                      :selected.sync="selectedThree"
                      :pagination.sync="serverPaginationThree"
                      @request="listGetThree"
                      row-key="id"
              >
                <template slot="body" slot-scope="props">
                  <q-tr :props="props" >
                    <q-td >
                      <q-checkbox color="primary" v-model="props.selected"></q-checkbox>
                    </q-td>
                    <q-td key="action" :props="props">
                      <q-btn
                              flat
                              size="xs"
                              color="primary"
                              class="q-pa-xs"
                              @click="quotedView(props.row.id,props.row.rfqItemId)"
                      >
                        {{ $t('查看报价') }}
                      </q-btn>
              <!--         <q-btn
                              flat
                              size="xs"
                              color="primary"
                              class="q-pa-xs"
                              v-if="props.row.time != 5"
                              @click="modifyEnquiryPrice(props.row.id,props.row.rfqItemId)"
                      >
                        {{ $t('修改报价') }}
                      </q-btn> -->
                    </q-td>
                    <q-td key="matName" :props="props" >
                      {{ props.row.rfqItemEntity.matName }}
                    </q-td>
                    <q-td key="matCode" :props="props" >
                      {{ props.row.rfqItemEntity.matCode }}
                    </q-td>
                    <q-td key="quoteTempName" :props="props" >
                      {{ props.row.rfqItemEntity.quoteTempName }}
                    </q-td>
                    <q-td key="type" :props="props" >
                      <span class="text-light" v-if="props.row.type ==1">前期询价</span>
                      <span class="text-light" v-if="props.row.type ==2">正式报价 </span>
                    </q-td>
                    <q-td key="time" :props="props" >
                      {{ props.row.time }}
                    </q-td>
                    <q-td key="status" :props="props" >
                      <span class="text-light" v-if="props.row.status ==0">未报价</span>
                      <span class="text-light" v-if="props.row.status ==1">已报价</span>
                      <span class="text-light" v-if="props.row.status ==-1">报价中</span>
                    </q-td>
                    <q-td key="quantity" :props="props" >
                      {{ props.row.rfqItemEntity.quantity }}
                    </q-td>
                    <q-td key="totalPrice" :props="props" >
                      {{ props.row.totalPrice }}
                    </q-td>
                    <q-td key="rfqItemEntity.currencyName" :props="props" >
                      {{ props.row.rfqItemEntity.currencyName }}
                    </q-td>
                  </q-tr>
                </template>
              </q-table>
              <div class="row justify-end items-center text-faded">
                每页的行数：
                <q-select
                        :options="[{label: '5', value: 5},{label: '10', value: 10},{label: '20', value: 20}]"
                        hide-underline
                        class="q-mr-md"
                        v-model="serverPaginationThree.rowsPerPage"></q-select>
                第
                <q-pagination
                        class="q-mt-xs"
                        v-model="serverPaginationThree.page"
                        input
                        boundary-links
                        direction-links
                        :max-pages="5"
                        :ellipses="true"
                        :max="pagesThree"></q-pagination>
                页 &nbsp; 共 {{ totalThree }} 条
              </div>
            </q-tab-pane>
          </q-tabs>
        </q-card-main>
      </q-card>
      <q-toolbar slot="footer" color="white" class="row justify-end">
        <q-btn
                flat
                color="primary"
                @click="historicalQuotationModal = false">{{$t("取消")}}</q-btn>
        <!--<q-btn
                flat
                :loading="btnLoading"
                color="primary"
                @click="signUpOrRefuseClick(-1)">{{$t("保存")}}</q-btn>-->
      </q-toolbar>
    </q-modal-layout>
  </q-modal>
</div>

<!-- ie-polyfill 、 vue.js and quasar-framework -->
<script src="../lib/js/quasar.ie.polyfills.umd.min.js"></script>
<script src="../lib/js/vue.js"></script>
<script src="../lib/js/quasar.mat.umd.min.js"></script>
<!-- babel for es6 transform -->
<!-- <script src="lib/js/babel.min.js"></script> -->
<!-- vue validate -->
<script src="../lib/js/vuelidate.min.js"></script>
<script src="../lib/js/validators.min.js"></script>
<!-- consts and utils ps: always leave this file first -->
<script src="../script/consts.js"></script>
<script src="../script/utils.js"></script>
<!-- status code -->
<script src="../script/status.code.js"></script>
<!-- qs for axios -->
<script src="../lib/js/qs.min.js"></script>
<!-- axios for http request -->
<script src="../lib/js/axios.js"></script>
<!-- axios.instance must be after axios -->
<script src="../script/axios.instance2.js"></script>
<!-- quasar i18n zh-hans -->
<script src="../lib/lang/zh-hans.js"></script>
<!-- vue-i18n for application's internationalization -->
<script src="../lib/js/vue-i18n.js"></script>
<!-- current page international file -->
<script src="../lang/sor/rfxPurAdd.js"></script>

<script>
  // quasar components use
  Quasar.i18n.set(Quasar.i18n[LANGUGE])
  new Vue({
    el: '#q-rfxVendorEnquiryPriceView',
    i18n: i18n,
    data: function() {
      return {
        // loadings
        btnLoadingSearch: false,
        btnLoadingReset: false,
        // search
        searchFormRow: {
          key: 'matCode',
          value: ''
        },
        mainTab: 'mainInfo',
        selectedTab: 'tab-1',
        listLoading: false,
        listLoadingTwo: false,
        listLoadingThree: false,
        tableData: [],
        tableDataTwo: [],
        tableDataThree: [],
        selectedOne: [],
        selectedTwo: [],
        selectedThree: [],
        serverPagination: {
          page: 1,
          rowsPerPage: 5,
          rowsNumber: 5
        },
        total: 0,
        serverPaginationTwo: {
          page: 1,
          rowsPerPage: 5,
          rowsNumber: 5
        },
        totalTwo: 0,
        serverPaginationThree: {
          page: 1,
          rowsPerPage: 10,
          rowsNumber: 10
        },
        totalThree: 0,
        searchForm: {
          name: ''
        },
        downloadUrl: baseURL + '/manager/rfq/file/download/', // 下载地址
        baseInfoForm: {
          title:'',
          type:'',
          isSeal:'',
          purOrgName:'',
          purGroupName:'',
          purExecutorName:'',
          isSignUp:'',
          signUpStartTime:'',
          signUpEndTime:'',
          quoteStartTime:'',
          quoteEndTime:'',
          quoteModifyTimes:'',
          isTr:'',
          trFileId: '',
          remark:''
        },

        // 通用
        addOrEdit: 1, // 1 新增 2 编辑
        disable: true,
        historicalQuotationModal: false,
        rfqItemId:0
      }
    },
    computed: {
      columnsOne: function() {
        return [
          {
            name: 'action',
            label: this.$t('操作'),
            align: 'center'
          },
          {
            name: 'matName',
            label: '零件名称',
            align: 'center'
          },
          {
            name: 'matCode',
            label: '零件编码',
            align: 'center'
          },
          {
            name: 'matCategoryName',
            label: '品类',
            align: 'center'
          },
          {
            name: 'quantity',
            label: '数量',
            align: 'center'
          },
          {
            name: 'unitName',
            label: '价格单位',
            align: 'center'
          },
          {
            name: 'currencyName',
            label: '币种',
            align: 'center'
          },
          {
            name: 'quoteTempName',
            label: '报价模板',
            align: 'center'
          },
          {
            name: 'isMoldCostShare',
            label: '模具摊销',
            align: 'center'
          }
        ]
      },
      columnsTwo: function() {
        return [
          {
            name: 'action',
            label: this.$t('操作'),
            align: 'center'
          },
          {
            name: 'fileName',
            label: '文件名称',
            align: 'center'
          },
          {
            name: 'suffix',
            label: '格式',
            align: 'center'
          },
          {
            name: 'updateUserName',
            label: '修改人',
            align: 'center'
          },
          {
            name: 'lastUpdateTime',
            label: '修改时间',
            align: 'center'
          },
          {
            name: 'remark',
            label: '说明',
            align: 'center'
          },
        ]
      },
      columnsThree: function() {
        return [
          {
            name: 'action',
            label: this.$t('操作'),
            align: 'center'
          },
          {
            name: 'matName',
            label: '  零件名称',
            align: 'center'
          },
          {
            name: 'matCode',
            label: '零件编码',
            align: 'center'
          },
          {
            name: 'quoteTempName',
            label: '报价模版',
            align: 'center'
          },
          {
            name: 'type',
            label: '报价类型',
            align: 'center'
          },
          {
            name: 'time',
            label: '轮次',
            align: 'center'
          },
          {
            name: 'status',
            label: '状态',
            align: 'center'
          },
          {
            name: 'quantity',
            label: '数量',
            align: 'center'
          },
          {
            name: 'totalPrice',
            label: '总价',
            align: 'center'
          },
          {
            name: 'rfqItemEntity.currencyName',
            label: '币种',
            align: 'center'
          },
        ]
      },
      pages: function() {
        return Math.ceil(this.total/this.serverPagination.rowsPerPage)
      }
      ,
      pagesTwo: function() {
        return Math.ceil(this.totalTwo/this.serverPaginationTwo.rowsPerPage)
      },
      pagesThree: function() {
        return Math.ceil(this.totalThree/this.serverPaginationThree.rowsPerPage)
      }
    },
    watch: {
      'serverPagination.page': function(rowsPerPage) {
        this.listGet({ pagination: this.serverPagination })
      },
      'serverPagination.rowsPerPage': function(rowsPerPage) {
        this.listGet({ pagination: this.serverPagination })
      },
      'serverPaginationTwo.page': function(rowsPerPage) {
        this.listGetTwo({ pagination: this.serverPaginationTwo })
      },
      'serverPaginationTwo.rowsPerPage': function(rowsPerPage) {
        this.listGetTwo({ pagination: this.serverPaginationTwo })
      },
      'serverPaginationThree.page': function(rowsPerPage) {
        this.listGetThree({ pagination: this.serverPaginationThree })
      },
      'serverPaginationThree.rowsPerPage': function(rowsPerPage) {
        this.listGetThree({ pagination: this.serverPaginationThree })
      }
    },
    created: function() {
      this.listGet({
        pagination: this.serverPagination
      }),
      this.listGetTwo({
         pagination: this.serverPaginationTwo
        }),
       this.listGetThree({
            pagination: this.serverPaginationThree
        }),
        this.signUp(),
        this.getTab()
    },
    methods: {
      listGet: function(arg) {
        var args = GetRequest();
        var that = this
        this.listLoading = true
        this.serverPagination = arg.pagination
        axios({
          method: 'post',
          url: '/manager/rfq/item/query',
          data: {
            page: this.serverPagination.page,
            rows: this.serverPagination.rowsPerPage,
            sort: this.serverPagination.sortBy,
            order: this.serverPagination.descending == true? 'desc' : (this.serverPagination.descending == false? 'asc' : null),
            // 'search_LIKE_matCode': this.searchForm.search_LIKE_matCode,
            search_LIKE_matCode: this.searchFormRow.key == 'matCode'? this.searchFormRow.value: '',
            'search_EQ_rfqHeaderEntity.id': args.headerId,
          }
        })
        .then(function(data) {
          that.tableData = data.rows
          that.total = data.total
          that.listLoading = false
          that.btnLoadingSearch = false
          that.btnLoadingReset = false
        })
        .catch(function(err) {
          console.log(err)
        })
      },
      // 明细 查询
      searchDetails: function() {
        this.btnLoadingSearch = true
        this.listGet({
          pagination: this.serverPagination
        })
      },
      resetDetails: function() {
        this.btnLoadingReset = true
        this.searchFormRow = {  
          value: '',
          key: 'matCode'
        }
        this.listGet({
          pagination: this.serverPagination
        })
      },
      listGetTwo: function(arg) {
        var args = GetRequest();
        var that = this
        this.listLoadingTwo = true
        this.serverPaginationTwo = arg.pagination
        axios({
          method: 'post',
          url: '/manager/rfq/file/query',
          data: {
            page: this.serverPaginationTwo.page,
            rows: this.serverPaginationTwo.rowsPerPage,
            sort: this.serverPaginationTwo.sortBy,
            order: this.serverPaginationTwo.descending == true? 'desc' : (this.serverPaginationTwo.descending == false? 'asc' : null),
            'search_EQ_busId': args.headerId,
          }
        })
        .then(function(data) {
          that.tableDataTwo = data.rows
          that.totalTwo = data.total
          that.listLoadingTwo = false
        })
        .catch(function(err) {
          console.log(err)
        })
      },
      listGetThree: function(arg) {
        var args = GetRequest();
        var that = this
        this.listLoadingThree = true
        this.serverPaginationThree = arg.pagination
        axios({
          method: 'post',
          url: '/manager/rfqvendor/quote/queryByRfqSupplierIdAndRfqItemId/'+args.id+"/"+this.rfqItemId,
          data: {
            page: this.serverPaginationThree.page,
            rows: this.serverPaginationThree.rowsPerPage,
            sort: this.serverPaginationThree.sortBy,
            order: this.serverPaginationThree.descending == true? 'desc' : (this.serverPaginationThree.descending == false? 'asc' : null),
          }
        })
        .then(function(data) {
          that.tableDataThree = data.rows
          that.totalThree = data.total
          that.listLoadingThree = false
        })
        .catch(function(err) {
          console.log(err)
        })
      },
      back:function () {
        window.location.href = 'rfxVendorList.html'
      },
      signUp:function () {
        var args = GetRequest();
        var that = this
        axios({
          method: 'post',
          url: '/manager/rfqvendor/main/getInfo/'+args.id
        })
        .then(function(data) {
          that.baseInfoForm = {
            title:data.data.rfqHeaderEntity.title,
            type:data.data.rfqHeaderEntity.type,
            isSeal:data.data.rfqHeaderEntity.isSeal,
            purOrgName:data.data.rfqHeaderEntity.purOrgName,
            purGroupName:data.data.rfqHeaderEntity.purGroupName,
            purExecutorName:data.data.rfqHeaderEntity.purExecutorName,
            isSignUp:data.data.rfqHeaderEntity.isSignUp,
            signUpStartTime:data.data.rfqHeaderEntity.signUpStartTime,
            signUpEndTime:data.data.rfqHeaderEntity.signUpEndTime,
            quoteStartTime:data.data.rfqHeaderEntity.quoteStartTime,
            quoteEndTime:data.data.rfqHeaderEntity.quoteEndTime,
            quoteModifyTimes:data.data.rfqHeaderEntity.quoteModifyTimes,
            isTr:data.data.rfqHeaderEntity.isTr,
            trFileId: data.data.rfqHeaderEntity.trFileId,
            remark:data.data.remark
          }
        })
        .catch(function(err) {
          console.log(err)
        })
      },
      historicalQuotation:function (id) {
        this.historicalQuotationModal = true;
        this.rfqItemId=id;
        this.listGetThree({ pagination: this.serverPaginationThree })
      },
      downloadFile:function (fileId) {
        window.location.href = baseURL +'/manager/rfq/file/download/'+fileId
      },
      //修改报价
      modifyEnquiryPrice:function (id,rfqItemId) {
        var args = GetRequest();
        window.location.href = 'rfxVendorProductionQuotationTemplate.html?rfqItemId=' + rfqItemId+'&headerId='+args.headerId+'&rfqSupplierId='+args.id+'&quoteId='+id+'&type=2'
      },
      quotedView:function (id,rfqItemId) {
        var args = GetRequest();
        window.location.href = 'rfxVendorProductionQuotationView.html?rfqItemId=' + rfqItemId+'&headerId='+args.headerId+'&rfqSupplierId='+args.id+'&quoteId='+id+'&type=2'

      },
      getTab:function(){
        var args = GetRequest();
        if(args.tab!=null){
          this.selectedTab= args.tab
        }
      }
    }
  })
</script>
</body>
</html>